home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 May / EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso / earcd / misc / emu / arosdev.lha / AROS / rom / utility / utility_intern.h < prev   
C/C++ Source or Header  |  1997-01-27  |  4KB  |  160 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: utility_intern.h,v 1.9 1997/01/27 15:22:20 ldp Exp $
  4.     $Log: utility_intern.h,v $
  5.     Revision 1.9  1997/01/27 15:22:20  ldp
  6.     Include proto instead of clib
  7.  
  8.     Revision 1.8  1997/01/08 03:36:14  iaint
  9.     A few more utility.lib functions
  10.  
  11.     Revision 1.7  1996/12/18 01:27:36  iaint
  12.     NamedObjects
  13.  
  14.     Revision 1.6  1996/10/24 15:51:39  aros
  15.     Use the official AROS macros over the __AROS versions.
  16.  
  17.     Revision 1.5  1996/09/13 17:10:55  aros
  18.     Don't use the TOLOWER() and TOUPPER() macros directly.
  19.  
  20.     Revision 1.4  1996/09/12 14:52:47  digulla
  21.     Better way to separate public and private parts of the library base
  22.  
  23.     Revision 1.3  1996/08/31 12:58:14  aros
  24.     Merged in/modified for FreeBSD.
  25.  
  26.     Revision 1.2  1996/08/01 17:41:42  digulla
  27.     Added standard header for all files
  28.  
  29.     Desc:
  30.     Lang:
  31. */
  32. #ifndef UTILITY_INTERN_H
  33. #define UTILITY_INTERN_H
  34.  
  35. #ifndef EXEC_TYPES_H
  36. #include <exec/types.h>
  37. #endif
  38. #ifndef EXEC_NODES_H
  39. #include <exec/nodes.h>
  40. #endif
  41. #ifndef EXEC_LISTS_H
  42. #include <exec/lists.h>
  43. #endif
  44. #ifndef EXEC_LIBRARIES_H
  45. #include <exec/libraries.h>
  46. #endif
  47. #ifndef EXEC_MEMORY_H
  48. #include <exec/memory.h>
  49. #endif
  50. #ifndef EXEC_IO_H
  51. #include <exec/io.h>
  52. #endif
  53. #ifndef EXEC_SEMAPHORES_H
  54. #include <exec/semaphores.h>
  55. #endif
  56. #ifndef UTILITY_TAGITEM_H
  57. #include <utility/tagitem.h>
  58. #endif
  59. #ifndef UTILITY_NAME_H
  60. #include <utility/name.h>
  61. #endif
  62. #ifndef UTILITY_DATE_H
  63. #include <utility/date.h>
  64. #endif
  65. #ifndef UTILITY_PACK_H
  66. #include <utility/pack.h>
  67. #endif
  68. #ifndef AROS_LIBCALL_H
  69. #include <aros/libcall.h>
  70. #endif
  71. #ifndef UTILITY_UTILITY_H
  72. #include <utility/utility.h>
  73. #endif
  74. #ifndef PROTO_EXEC_H
  75. #include <proto/exec.h>
  76. #endif
  77. #ifndef PROTO_UTILITY_H
  78. #include <proto/utility.h>
  79. #endif
  80. #ifndef PROTO_ALIB_H
  81. #include <proto/alib.h>
  82. #endif
  83.  
  84. /*
  85.     This is the internal version of the UtilityBase structure
  86. */
  87.  
  88. struct IntUtilityBase
  89. {
  90.     struct UtilityBase UBase;
  91.  
  92.     /*
  93.        This is where the private data starts.
  94.     */
  95.     struct ExecBase     *ub_SysBase;
  96.     ULONG                ub_LastID;
  97.  
  98.     struct NamedObject  *ub_GlobalNameSpace;
  99.  
  100.     /*
  101.         This should always be at the end, and it is only valid when the
  102.         library is loaded from disk, eg testing...
  103.  
  104.         The reference is still in here of course, it just means that
  105.         when I change the library base I will have to recompile most of
  106.         the files, oh well...
  107.     */
  108.     BPTR                 ub_SegList;
  109. };
  110.  
  111. /* digulla again... Needed for close() */
  112. #define expunge() \
  113.  AROS_LC0(BPTR, expunge, struct UtilityBase *, UtilityBase, 3, Utility)
  114.  
  115. #define GetIntUtilityBase(ub)   ((struct IntUtilityBase *)(ub))
  116. #define GetUtilityBase(ub)      (&GetIntUtilityBase(ub)->UBase)
  117.  
  118. #define SysBase         (GetIntUtilityBase(UtilityBase)->ub_SysBase)
  119.  
  120. /*
  121.     Internal versions of the NamedObject structures.
  122.     Access using GetIntNamedObject()
  123.  
  124.     I have a problem here of sorts. The autodocs do not give enough
  125.     information really. They say it is possible to nest NamedObjects
  126.     with namespaces, however the implementation didn't allow NamedObjects
  127.     with their own namespaces to be members of a namespace.
  128.  
  129.     However, the autodocs are right, so you can nest like that.
  130. */
  131.  
  132. struct NameSpace
  133. {
  134.     struct MinList          ns_List;
  135.     struct SignalSemaphore  ns_Lock;
  136.     ULONG                   ns_Flags;
  137. };
  138.  
  139. struct IntNamedObject
  140. {
  141.     struct NamedObject  no;
  142.  
  143.     struct Node         no_Node;
  144.     struct NameSpace   *no_ParentSpace;     /* The NameSpace I am in */
  145.     struct NameSpace   *no_NameSpace;       /* My NameSpace */
  146.     struct Message     *no_FreeMessage;
  147.     UWORD               no_UseCount;
  148.     BOOL                no_FreeObject;
  149. };
  150.  
  151. #define GetIntNamedObject(no)   ((struct IntNamedObject *)(no))
  152. #define GetNamedObject(no)      (&GetIntNamedObject(no)->no)
  153.  
  154.  
  155. /* Internal function prototypes */
  156. struct NameSpace *GetNameSpace(struct NamedObject *, struct UtilityBase *);
  157. struct IntNamedObject *IntFindNamedObj(struct NameSpace *, struct Node *, STRPTR, struct UtilityBase *);
  158.  
  159. #endif
  160.